<%@ page language="java" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <meta http-equiv=content-type
        content="text/html; charset=UTF-8"/>
  <title>团购列表</title>
  <link rel="stylesheet" href="../css/index.css" type="text/css" media="screen" charset="utf-8"/>
  <link rel="stylesheet" href="../css/jquery-ui-1.8.14.custom.css" type="text/css" media="screen" charset="utf-8"/>
  <script type="text/javascript" src="../js/jquery-1.6.js"></script>
  <script type="text/javascript" src="../js/jquery-ui-1.8.14.custom.min.js"></script>
  <script type="text/javascript" src="../js/common.js"></script>
  <script type="text/javascript">
    $(function() {
      $('#item_li').attr("class", "current");
      $("#dialog:ui-dialog").dialog("destroy");
      $("#dialog-add").dialog({
        autoOpen: false,
        height: 600,
        width: 520,
        modal: true,
        show: "clip",
        hide: "slide",
        buttons: {
          "确定": function() {
            $('#add-form :submit').click();
          },
          "关闭": function() {
            $(this).dialog('close');
          }
        }
      });
    });
  </script>
</head>
<body class="newbie">
<div id="pagemasker"></div>
<div id="dialog"></div>
<div id="doc">
  <jsp:include page="../common/adminHeader.jsp"/>

  <div id="bdw" class="bdw">
    <div id="bd" class="cf">
      <div id="coupons">
        <jsp:include page="../common/title/item_tab.jsp"/>


<div id="content" class="coupons-box clear mainwide">
  <div class="box clear">
    <div class="box-top"></div>
    <div class="box-content">
      <div class="head">
        <h2>团购列表&nbsp;<a href="#" onclick="$('#dialog-add').dialog('open')"><img
            src="../image/common/add.png" alt="添加" title="添加"/>
        </a></h2>
      </div>
      <div class="sect">
        <table cellspacing="0" cellpadding="0"
               border="0" class="coupons-table">
          <tr>
            <th width="30" align="center">ID</th>
            <th width="130">名称</th>
            <th width="35">城市</th>
            <th width="120">商户</th>
            <th width="150">起止时间</th>
            <th width="40">团购价</th>
            <th width="40">市场价</th>
            <th width="40">最低数量</th>
            <th width="40">最高数量</th>
            <th width="60" align="center">已成交</th>
            <th width="50">操作</th>
          </tr>
          <s:iterator id="item" value="items">
            <tr class="alt" id="team-list-id-3">
              <td align="center">${item.id}</td>
              <td><a href="/item.action?id=${item.id}">${item.name}</a></td>
              <td>
                <a href="/admin/editCity.action?id=${item.city.id}">${item.city.chnName}</a>
              </td>
              <td>
                <a href="/admin/editMerchant.action?id=${item.merchant.id}">${item.merchant.name}</a>
              </td>
              <td>${item.formatBeginTime}<br>${item.formatEndTime}</td>
              <td>￥${item.groupPrice}</td>
              <td>￥${item.marketPrice}</td>
              <td>${item.minCount}</td>
              <td>${item.maxCount}</td>
              <td>${item.currentCount}</td>
              <td class="op">
                <a href="/admin/editItem.action?id=${item.id}"><img
                    src="../image/common/edit.png" alt="编辑" title="编辑"/></a>&nbsp;
                <a onclick="confirmDelete('确认删除团购商品${item.name}?<br><br>此操作无法恢复!',
                   '/admin/deleteItem.action?id=${item.id}')" href="#"><img
                    src="../image/common/cross.png" alt="删除" title="删除"/></a>
              </td>
            </tr>
          </s:iterator>
          <tr>
            <jsp:include page="../common/pager.jsp"/>
          </tr>
        </table>
      </div>
    </div>
    <div class="box-bottom"></div>
  </div>
</div>



      </div>
    </div>
  </div>
  <jsp:include page="../common/footer.jsp"/>
</div>
</body>
</html>
<jsp:include page="../common/dialog/item_dialog.jsp"/>